<template>
    <section>
        <el-col >
            <div class="section-content clearfix">
                <el-tree
                :data="query"
                :props="defaultProps"
                node-key="id"
                default-expand-all
                :expand-on-click-node="false"
                :render-content="renderContent"
                ></el-tree>
            </div>
        </el-col>
    </section>
</template>

<script>
import {
    companytree_query
} from "../../../api/api"
export default {
    data(){
        return{ 
            query:[],
            defaultProps: {
                children: "childrens",
                label: "name"
            },
        }
    },
    methods:{
        getMenutree(){
            let para = {
                companyId:sessionStorage.getItem('dendrogram_detail')
            }
            
            companytree_query(para).then((res) => {
                this.query.push(res.data)
                console.log(this.array)
            })  
             
        },
        renderContent(h, { node, data, store }) {
            console.log(node)
            console.log(data)
             return (
                <span style="">
                <div style="border:1px solid #2F8DFB ;padding:10px">
                    <div style='font-size:18px;font-weight:bold;'>
                      {node.label}
                    </div>
                    <div>
                      管理员:{data.adminUser.userName}
                    </div>
                    <div>
                      电话:{data.adminUser.phone}
                    </div>
                </div>
        
                </span>
            );
        },

    },
    mounted(){
        this.getMenutree()
    }
}
</script>

<style>
   .section-content>.el-tree>.el-tree-node>.el-tree-node__content {
        height: 100px;
   }
   /* .section-content>.el-tree>.el-tree-node>.el-tree-node__children>.el-tree-node>.el-tree-node__content{
        height: 100px;
   }  */

    .el-tree-node__content{
         height: 100px;
    }
    .el-tree-node__content>.el-tree-node__expand-icon{
        margin-top: -80px;
    }
</style>